<?php 
      echo $this->Html->css("chosen");
      echo $this->Html->css("dataTables");
 ?>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/dataTables.min.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/customInput.jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/chosen.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/zice.custom1.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/ColVis.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/accounting.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/layout_table.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/manager_retail.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine-vi.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.autotab.js"></script>

<div class="titlePage">
<h1>Quản lý hóa đơn - Hóa đơn Bán lẻ</h1>
</div>

<div class="onecolumn">
	<div class="header">
	<span>
		<span class="ico gray window"></span>
		Tìm kiếm hóa đơn
	</span>
	</div>
	<div class="clear"></div>
	<div class="content" style="display: inline-block; width: 95%;">
		<form id="formSearch" method="post" action="">
			<div class="section">
				<label> Mã HĐ :</label>   
                <input type="text" name="idInvoice" class='validate[custom[number]]' />
            </div>
			<div class="section" style="float:left; width: 40%; border-bottom: none;">
				<label>
				Khách hàng:
				
				</label>
				<div id='search_cus'>
					<input type="text" name="choose_cus"/>		
				</div>
			</div>
			<div class="section" style="float:left; width: 30%; border-bottom: none;">
				<label> Tổng tiền </label>   
                <div>Từ <input type="text" name="totalStart"/></div>
                <div>đến <input type="text" name="totalEnd"/></div>
            </div>
            <div class="section" style="float:left; width: 30%;border-bottom: none;">
                <label>Ngày mua:</label>   
                <div>Từ <input type="text"  id="dateStart" class="dateStart" name="dateStart"  /></div>
                <div>đến <input type="text"  id="dateEnd" class="dateEnd" name="dateEnd"  /></div>
            </div> 
            <input type="hidden"  id="isSearch" class="isSearch" name="isSearch" value="1"/> 
            <div class="buttonSearchInvoice" style="text-align: center;">
				<a class="uibutton" id='search_invoice'><span class="ico gray checkmark2"></span>Tìm kiếm</a>
				<div id='alert_mes'></div>
			</div>
		</form>
	</div>
</div>
<?php if($isSearch){?>
<div class="onecolumn invoice">
	<div class="header">
	<span>
		<span class="ico gray spreadsheet"></span>
		DANH SÁCH HÓA ĐƠN
	</span>
	</div>
	<div class="clear"></div>
	<div class="content">
		<form>
			<div class="tableName">
				<table class="display data_table2 listReInvoice" >
					<thead>
						<tr>
							<th><div class="th_wrapp">Tên</div></th>
							<th><div class="th_wrapp">Địa chỉ</div></th>
							<th><div class="th_wrapp">Điện thoại</div></th>
							<th><div class="th_wrapp">Tổng tiền</div></th>
							<th><div class="th_wrapp">Ngày mua</div></th>
						</tr>
					</thead>
					<tbody>
					<?php 
						foreach ($list_invoice as $item) {
					?>
							<tr class="odd gradeX ReInvoice" id="<?php  echo $item['r']['id']; ?>">
		      					<td><?php  echo $item['r']['cus_name'];?></td>
		      					<td><?php  echo $item['r']['cus_address'];?></td>
		      					<td><?php  echo $item['r']['cus_phone'];?></td>
		      					<td class='formatMoney'><?php  echo $item['r']['total']; ?></td>
		      					<td><?php  echo date('d/m/Y H:i',strtotime($item['r']['date']));?></td>
		      					</tr><?php }?>
					</tbody>
				</table>
	            </div>
		</form>
	</div>
</div>
<div class="onecolumn listInvoiceProduct">
<div class="header">
	<span>
		<span class="ico gray paragraph_justify"></span>
		CHI TIẾT HÓA ĐƠN
	</span>
	</div>
	<div class="clear"></div>
	<div class="content">
		<form>
			<div id="result_choose_re_invoice">
			
			</div>
		</form>
	</div>
</div>
<?php }?>